﻿using System;
using System.Web.UI;
using Vega.USiteBuilder;

namespace kelvinDigital.USiteBuilderAdmin
{
    public partial class uSiteBuilderRefresh : System.Web.UI.Page
    {
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (Request.RequestType == "POST")
            {
                UmbracoManager.SynchronizeAllDataTypes();
                UmbracoManager.SynchronizeAllTemplates();
                UmbracoManager.SynchronizeAllDocumentTypes();

                if(Request.QueryString["WithPrejudice"] == "true")
                {
                    UmbracoManager.CleanUpDocumentTypes();
                }      
                
                Response.Write("Done");
            }   
        }
    }
}